<!-- Modal -->
<div class="modal-dialog wide" style="width: 550px;">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel">
            <#if ambTjjgyj??>
                <#if ambTjjgyj.id??>
                    编辑
                <#else>
                    新增
                </#if>
            </#if>
            </h4>
        </div>
        <div class="modal-body">
            <div id="errorMessage"><#include "../../message.ftl" /></div>
            <form class="form-horizontal" role="form" id="ambTjjgyjForm" method="post"
                  action="${absoluteContextPath}/amb/ambTjjgyj/save">
            <#if ambTjjgyj??>
                <#if ambTjjgyj.id??>
                    <input type="hidden" name="id" value="${ambTjjgyj.id}"/>
                <#else>
                    <input type="hidden" name="id" value=""/>
                </#if>
            </#if>
                <div class="row">
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label"></label>

                        <div class="col-sm-6">
                            <input name="id" value="${ambTjjgyj.id!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">年</label>

                        <div class="col-sm-6">
                            <input name="nian" value="${ambTjjgyj.nian!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">类型</label>

                        <div class="col-sm-6">
                            <input name="tjjgtype" value="${ambTjjgyj.tjjgtype!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">一月</label>

                        <div class="col-sm-6">
                            <input name="jan" value="${ambTjjgyj.jan!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">二月</label>

                        <div class="col-sm-6">
                            <input name="feb" value="${ambTjjgyj.feb!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">三月</label>

                        <div class="col-sm-6">
                            <input name="mar" value="${ambTjjgyj.mar!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">四月</label>

                        <div class="col-sm-6">
                            <input name="apr" value="${ambTjjgyj.apr!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">五月</label>

                        <div class="col-sm-6">
                            <input name="may" value="${ambTjjgyj.may!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">六月</label>

                        <div class="col-sm-6">
                            <input name="jun" value="${ambTjjgyj.jun!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">七月</label>

                        <div class="col-sm-6">
                            <input name="jul" value="${ambTjjgyj.jul!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">八月</label>

                        <div class="col-sm-6">
                            <input name="aug" value="${ambTjjgyj.aug!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">九月</label>

                        <div class="col-sm-6">
                            <input name="sep" value="${ambTjjgyj.sep!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">十月</label>

                        <div class="col-sm-6">
                            <input name="oct" value="${ambTjjgyj.oct!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">十一月</label>

                        <div class="col-sm-6">
                            <input name="nov" value="${ambTjjgyj.nov!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">十二月</label>

                        <div class="col-sm-6">
                            <input name="dece" value="${ambTjjgyj.dece!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                </div>
            </form>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
            <button type="button" class="btn btn-primary" onclick="save();">保存</button>
        </div>
    </div>
</div>
<script>
    function save() {
        $("#" + "ambTjjgyjForm").ajaxSubmit({
            success: function (data) {
                data = JSON.parse(data);
                if (data.returnCode == 1) {
                    $('#myModal').modal("hide");
                    $.showMessage({parentId: "showMessage", message: "信息保存成功！", type: "success"});
                    refreshTable();
                } else {
                    $.showMessage({parentId: "errorMessage", message: "<strong>错误信息</strong>：" + data.returnMsg, type: "error"});
                }
            }
        });
    }
</script>